<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>新增租户资料</title>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/global.js"></script>
<script language="javascript" src="${ctx}/scripts/common/prototype.js"></script>

<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common.js"></script>

<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/show.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/styles/public.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">




<script type="text/javascript">

     var participantTypeCode = null;
	var lesseeBaseIndex = null;
	var lesseehouseIndex = null;
	var flag_button_click=true;

	function quickMenue1(event)
	{

		ShowContextMenu(event,'quick_rightmenu');

	}
	function quickMenue2(event)
	{
		ShowContextMenu(event,'quick_rightmenu2');
	}
	function quickMenue3(event)
	{
		ShowContextMenu(event,'quick_rightmenu3');
	}

	function openAddLessee(){
		var url = "${ctx}/customer_lesseeAction.do?method=initLessBaseAdd";
		top.windowOpen(url, "initLesseeAdd", "新增租户资料", 550, 750);
	}

	function openAddHouse()
  {
  	var url = "${ctx}/customer_lesseeAction.do?method=initLesseeHouseAdd";
	top.windowOpen(url, "houseChoose", "新增住房信息", 230, 450,true,"houseChoose");
  }


	function openEditLessee(){

     if(lesseeBaseIndex == null) {
	alert("请选择一条记录");
	return false;
	}
		var url = "${ctx}/customer_lesseeAction.do?method=initLesseeBaseEdit&lesseeBaseIndex=" + lesseeBaseIndex + "&participantTypeCode=" + participantTypeCode;

		top.windowOpen(url,'lesseeEditFrm','修改租户资料',670,900,false,"lesseeEditFrm");
	}

	function openDelete(){
	if(lesseeBaseIndex == null) {
	alert("请选择一条记录");
	return false;
	}
		if(!confirm('你确定要删除该条记录吗?'))
			return;
		var str = "index=" + lesseeBaseIndex;

		var myAjax = new Ajax.Request("${ctx}/customer_lesseeAction.do?method=deleteLesseeBaseCache",
                   {method: 'post', parameters: str, onComplete: refurbishLesseeList}
                   );
	}

	function openHouseDelete(){

		if(lesseehouseIndex == null) {
		alert("请选择一条记录");
		return false;
		}
		if(!confirm('你确定要删除该条记录吗?'))
			return;
		var str = "index=" + lesseehouseIndex;

		var myAjax = new Ajax.Request("${ctx}/customer_lesseeAction.do?method=deleteCustomerHouseCache",
                   {method: 'post', parameters: str, onComplete: refreshLesseeHouseList}
                   );
	}


	function refurbishLesseeList(){
		lesseeBaseIndex = null;
	flag_button_click=false;
	 parent.setFamilyUnEdit();
	 parent.setFlagButtonClick(flag_button_click);
	document.getElementById("lesseeBaseList").src="${ctx}/customer_lesseeAction.do?method=initLesseeBaseList";
	}

	function refreshLesseeHouseList(){
	lesseehouseIndex = null;
	flag_button_click=false;
	parent.setFlagButtonClick(flag_button_click);
	 parent.setFamilyUnEdit();
	document.getElementById("lesseeHouseList").src="${ctx}/customer_lesseeAction.do?method=findLesseeHouseCachePage";
  }

	function setVar(participantTypeCode_,ownerBaseIndex_){
		participantTypeCode = participantTypeCode_;
		lesseeBaseIndex = ownerBaseIndex_;

	}
	function setVar2(Index_){

		lesseehouseIndex = Index_;

	}

	function getFlagButtonClick(){
		return flag_button_click;
	}

	function setFlagButtonClick(){
	 flag_button_click=true;
	}



</script>
</head>

<body>
 <div style="overflow:auto; height:400px;">
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
              <tr>
                <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                    <tr>
                      <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color"  style="display:show">
                        <tr>
                          <td colspan="4" class="aux_titletable">住房信息</td>
                        </tr>
                      </table>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_line">
                        <tr>
                          <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" >
                              <tr>
                                <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="35%" align="right"><table border="0" cellpadding="0" cellspacing="0" id="ico1">
                                          <tr>
                                            <td class="toolbarico"><a href="#"  onclick="openAddHouse();"onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新增"/>&nbsp;</a></td>

                                            <td class="toolbarico"><a href="#" onClick="openHouseDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom"></a></td>
                                            <td  class="toolbarico">&nbsp;</td>
                                          </tr>
                                      </table></td>
                                    </tr>
                                </table></td>
                              </tr>
                              <tr>
                                <td colspan="5" >
									<iframe id="lesseeHouseList"  name="lesseeHouseList" frameborder="0" src="${ctx}/customer_lesseeAction.do?method=findLesseeHouseCachePage" width="100%" style="z-index:0"></iframe>
								</td>
                              </tr>
                                     </table>


        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color"  style="display:show">
                          <tr>
                            <td colspan="4" class="aux_titletable">租户资料</td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_line">
                        <tr>
                          <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" >
                              <tr>
                                <td class="bg_toolBar"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="35%" align="right"><table border="0" cellpadding="0" cellspacing="0" id="ico1">
                                          <tr>
                                            <td class="toolbarico"><a href="#"  onclick="openAddLessee()" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新建"/>&nbsp;</a></td>
                                            <td  class="toolbarico" ><a href="#" onFocus="this.blur()" onClick="openEditLessee();"><img src="${ctx}/images/ico_amend.gif" alt="修改" width="16" height="16" border="0" align="absbottom" /></a></td>
                                            <td class="toolbarico"><a href="#" onClick="openDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom"></a></td>
                                            <td  class="toolbarico">&nbsp;</td>
                                          </tr>
                                      </table></td>
                                    </tr>
                                </table></td>
                              </tr>
                              <tr>
                                <td colspan="5" >
                                	<iframe id="lesseeBaseList"  name="lesseeBaseList" frameborder="0" src="${ctx}/customer_lesseeAction.do?method=initLesseeBaseList" width="100%" ></iframe>
                                </td>
                        </tr>
                      </table></td>
                    </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
      </table>

</td>
</tr>
</table>
</td>
</tr>
</table>
</div>


</body>
</html>